
package cn.hfgf.springmvc.controller;
 
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
@RequestMapping(value = "/HelloWorld")
public class HelloWorldController {
    private static final Logger LOGGER = Logger.getLogger(HelloWorldController.class);
 
    @RequestMapping("/hello")
    public String hello(Model model) {
        return"login";
         
    }

    @RequestMapping(value = "/login",method = RequestMethod.GET)
    public String login(String userName,String pwd,Model model){
        LOGGER.info("userName=" + userName + ",pwd=" + pwd);
        model.addAttribute("userName",userName);
        return "hello";
    }
 
}